import Vue from 'vue'
import 'normalize.css/normalize.css'

import App from './App.vue'

import ElementUI, { Message } from 'element-ui'
import Tooltip from 'tooltip.js'
import Copy from 'clipboard/dist/clipboard'
import moment from 'moment'
import SelfComponent from '@/components/index'

import './styles/element-variables.scss'

import '@/styles/index.scss'

import store from './store'
import router from './router'
import './icons' // icon
import './permission' // permission control
import Common from './utils/common.js'
import '@/api'
import wangEditor from "wangeditor";
// import { mockXHR } from '../mock'
// if (process.env.NODE_ENV === 'production') { mockXHR() }
// import JsonSchemaEditor from 'vue-json-schema-editor-visual';

// Vue.use(JsonSchemaEditor)

Vue.use(ElementUI)
// Vue.use(Message)
Vue.use(SelfComponent)

Vue.config.productionTip = false

Vue.prototype.Moment = moment
Vue.prototype.Tooltip = Tooltip
Vue.prototype.$Message = Message
Vue.prototype.Copy = Copy
Vue.prototype.Common = Common
Vue.prototype.wangEditor = wangEditor;

// 创建全局EventBus
var EventBus = new Vue();
Object.defineProperties(Vue.prototype, {
    $bus: {
        get: function () {
            return EventBus
        }
    }
})

new Vue({
    router,
    store,
    render: h => h(App)
}).$mount('#app')
